package com.bjesc_b2c.app.appraiset.mvp.presenter.impl;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.mvp.model.impl.DemandCarModelImpl;
import com.bjesc_b2c.app.appraiset.mvp.presenter.DemandCarPresenter;
import com.bjesc_b2c.app.appraiset.mvp.view.DemandCarView;

import java.util.List;

import master_bean.DemandCarBean;
import master_bean.FindCarBean;

/**
 * Created by yidong on 2017/5/24.
 */

public class DemandCarPresenterImpl implements DemandCarPresenter,DemandCarModelImpl.CallBack {
    private DemandCarView carView;
    private DemandCarModelImpl carModel;
    public DemandCarPresenterImpl(DemandCarView carView){
        this.carView = carView;
        carModel = new DemandCarModelImpl(this);
    }
    @Override
    public void getDemandCars(FindCarBean findBean) {
        carModel.getDemandCars((Context)carView,findBean);
    }

    @Override
    public void addDemandCar(Context context, String dispatchId, String carId,int type) {
        carModel.addDemandCar(context,dispatchId,carId,type);
    }

    @Override
    public void callback(List<DemandCarBean> listbean) {
        carView.getDemandCars(listbean);
    }

    @Override
    public void addSuccess() {
        carView.addCarSuccess();
    }
}
